package com.example.mycarcalling.activity;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.app.AlertDialog;

import com.example.mycarcalling.R;
import com.google.android.material.floatingactionbutton.FloatingActionButton;

public class NavSettlementDialog {
    public final static String TAG = NavSettlementDialog.class.getSimpleName();

    private final AlertDialog navSettlementDialog;
    private final FloatingActionButton fabBack;

    private final TextView tvDuration;
    private final TextView tvDistance;
    private final TextView tvDistanceUnit;

    private View inflate = null;


    public TextView getTvDuration() {
        return tvDuration;
    }

    public TextView getTvDistance() {
        return tvDistance;
    }

    public TextView getTvDistanceUnit() {
        return tvDistanceUnit;
    }

    public NavSettlementDialog(Context context){
        inflate = View.inflate(context, R.layout.dialog_nv_time_settlement,null);


        navSettlementDialog = new AlertDialog.Builder(context)
                .setView(inflate)
                .create();

        fabBack = inflate.findViewById(R.id.fab_settlement);
        tvDuration = inflate.findViewById(R.id.tv_duration_settlement);
        tvDistance = inflate.findViewById(R.id.tv_distance_settlement);
        tvDistanceUnit = inflate.findViewById(R.id.tv_distance_unit_settlement);

        fabBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }

    public void show() {
        navSettlementDialog.show();
    }

    public void dismiss() {
        navSettlementDialog.dismiss();
    }
}
